class LoginUser {
  int? id;
  String? email;
  String? nickname;
  String? headPic;
  int? level;
  DateTime? time;

  LoginUser({this.id,this.email,this.nickname,this.headPic,this.level,this.time});

  factory LoginUser.fromJson(Map<String,dynamic>? map){
    if(map == null) return LoginUser(id:-1);
    return LoginUser(
      id: map['id'],
      email: map['email'],
      nickname: map['nickname'],
      headPic: map['headPic'],
      level: map['level'],
      time: map['time']
    );
  }

  Map<String,dynamic> toJson(){
    final Map<String,dynamic> jsonData = <String,dynamic>{};
    jsonData['id'] = id;
    jsonData['email'] = email;
    jsonData['nickname'] = nickname;
    jsonData['headPic'] = headPic;
    jsonData['level'] = level;
    jsonData['time'] = time;
    return jsonData;
  }

  @override
  String toString(){
    return '{id:$id,email:$email,nickname:$nickname,level:$level}';
  }
}